home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network PC
/
Network PC.iso
/
amiga utilities
/
graphics
/
fractals
/
amountains
/
random.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1997-11-20
|
199 b
|
14 lines
#include <m68881.h>
#include <math.h>
double gaussian( void )
{
double ran;
do {
ran = drand48();
} while ( ran == 0.0 );
return sqrt( -2.0 * log( ran ) ) * cos( (2.0 * PI) * drand48() );
}